# demo07_file_write.py
fw = open("/opt/a.txt", mode="w")
fw.write("hello world\n")
fw.write("you are my babygirl~\n")
fw.close()  # fw.close() 自动刷新一次缓冲区
# 缓冲区
# fw.flush(): 只能在交互环境演示
# >>> fw = open("/opt/b.txt", mode="w")
# >>> fw.write("hello\n")
# 6
# >>> fw.flush()
# >>> fw.write("world\n")
# 6
# >>> fw.close()

